


public class MultiplyFunction extends Function{

	{
		order = 2;
	}
    
	public double evaluate(double[] vars){
		return children.get(0).evaluate(vars) 
			    * children.get(1).evaluate(vars);
	}
	
	public MultiplyFunction deepCopy(){
		MultiplyFunction returner = new MultiplyFunction();
		for(Node myChild:this.children){
			returner.children.add(myChild.deepCopy());
		}
		for(Node otherChild:returner.children){
			otherChild.parent = returner;
		}
		returner.size = this.size;
		return returner;
	}
	
	public String toString() {
		return "("+this.children.get(0)+"*"+this.children.get(1)+" )";
	}
}